<template>
  <div class="moveMainBox" v-if="connectionFail">
    <div class="mengchen"></div>
    <div class="moveMain">
      <div class="moveTitle">连接失败</div>
      <div class="moveMeddle">
        <span>请尝试以下操作：</span>
        <span>1.请确认设备电量充足，并处于开启状态 </span>
        <span>2.将设备靠近要连接的手机(10米以内)</span>
      </div>

      <div class="moveFoot">
        <span class="moveFootText" @click="handlerlater">稍后再试</span>
        <span class="moveFootLine"></span>
        <span class="moveFootText" @click="handleranew">重新连接</span>
      </div>
    </div>
  </div>
</template>

<script>
import { mapMutations } from "vuex";
export default {
  name: "connectionFail",
  props: ["connectionFail"],
  data() {
    return {};
  },
  methods: {
    ...mapMutations({ setBleSatuts: "ble/setBleSatuts" }),
    handlerlater() {
      this.$parent.$data.connectionFail = false;
    },
    handleranew() {
      this.setBleSatuts(1);
       this.$parent.$data.connectionFail = false;
    },
  },
};
</script>

<style lang="less" scoped>
.mengchen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--border);
}
.moveMain {
  position: absolute;
  width: 336px;
  height: 186px;
  //   background: red;
  background-color: var(--box_bg);
  opacity: 1;
  border-radius: 24px;
  left: 50%;
  transform: translate(-50%, 0);
  bottom: 16px;
  padding: 0 24px;
  .moveTitle {
    width: 288px;
    height: 56px;
    line-height: 56px;
    font-size: 20px;
    color: var(--font);
  }
  .moveMeddle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 288px;
    height: 66px;
    span {
      font-size: 16px;
      display: inline-block;
      color: var(--font);
    }
  }
  .moveFoot {
    width: 288px;
    height: 40px;
    // background-color: red;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 8px;
    .moveFootText {
      font-size: 16px;
      color: var(--color_blue);
    }
    .moveFootLine {
      width: 1px;
      height: 24px;
      background: var(--border);
    }
  }
}
</style>